Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor DC Outer Loops creation #1158

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

vmouradian
Copy link
Member

@vmouradian vmouradian commented Dec 18, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

Part of #1091 + adds consistency (imo)

What kind of change does this PR introduce?

Feature / refactor

What is the new behavior (if this is a feature change)?
DC Outerloops creation is made more consistent with AC ones (created in the OLF parameters class then are contained in DcLoadFlowParameters)

Support of outerLoopNames parameter for DC is in this separated PR : #1159.

Does this PR introduce a breaking change or deprecate an API?

  • No

@vmouradian vmouradian self-assigned this Dec 18, 2024
@vmouradian vmouradian changed the title Feature: Refactor DC Outer Loops creation Refactor DC Outer Loops creation Dec 18, 2024
@vmouradian
Copy link
Member Author

Support of OuterLoopNames parameters for DC is in this separated PR : #1159.
Can be merged into this branch or to main later

Comment on lines +188 to +191
// remove area interchange control outer loop if no area in the network, active power will be distributed with classical slack distribution
boolean areaInterchangeControl = outerLoops.stream().anyMatch(DcAreaInterchangeControlOuterLoop.class::isInstance);
if (!network.hasArea()) {
outerLoops.removeIf(DcAreaInterchangeControlOuterLoop.class::isInstance);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't remove the outerloop here.
the outerloop should handle the 'no area' situation by itself.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done to reproduce the behavior of DC slack distribution (which is done before equations solving and not via an outerloop).
So in the existing implementation of the AIC outreloops in the "no area" case :

  • The AC one defaults to distributed slack outerloop
  • The DC one does not handles the case because it should be handled by the DC LF engine (distribute slack before the other computations)

This is something that can be homogenized but I think it will be out of the scope of this refactoring

implements OuterLoop<V, E, P, C, O>, ActivePowerDistributionOuterLoop<V, E, P, C, O> {
implements ActivePowerDistributionOuterLoop<V, E, P, C, O> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since AbstractActivePowerDistributionOuterLoop implements ActivePowerDistributionOuterLoop, this part is redundant and can be removed too

implements ActivePowerDistributionOuterLoop<V, E, P, C, O>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes ! fixed in 929a5b8

static List<DcOuterLoop> createDcOuterLoops(LoadFlowParameters parameters, OpenLoadFlowParameters parametersExt) {
List<DcOuterLoop> outerLoops = new ArrayList<>();
if (parameters.isPhaseShifterRegulationOn()) {
DcIncrementalPhaseControlOuterLoop phaseShifterControlOuterLoop = new DcIncrementalPhaseControlOuterLoop();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, a small remark here, maybe a little bit out of the scope of this PR : when comparing with createAcOuterLoops, it shows that the parameter phaseShifterControlMode is not taken into account in DC mode. Maybe it should be mentioned in the doc (or even with a log message, because default value of this param is CONTINUOUS_WITH_DISCRETISATION and not INCREMENTAL)

Signed-off-by: vmouradian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for review
Development

Successfully merging this pull request may close these issues.

3 participants